package com.example.designpatterns.prototype;

import java.util.ArrayList;

public class Client {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("111");
        ConcretePrototype cp = new ConcretePrototype("2023", new Address("武汉"), list);
        ConcretePrototype clonecp = (ConcretePrototype) cp.clone();
        //用==比较引用地址
        System.out.println(cp.year == clonecp.year);
        System.out.println(cp.address == clonecp.address);
        System.out.println(cp.list == clonecp.list);
        clonecp.show();
    }
}
